<!DOCTYPE html>
<html lang="vi">
<head>
<title><?php echo (isset($meta['title']))?$meta['title']:$configAll['NAMESEO_PAGE']; ?></title>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="robots" content="noodp,noydir"/>
<meta name="description" content="<?php echo (isset($meta['des']))?$meta['des']:$configAll['DESSEO_PAGE']; ?>"/>
<meta name="keywords" content="<?php echo (isset($meta['keyword']))?$meta['keyword']:$configAll['KEYWORD_PAGE']; ?>"/>
<link rel="canonical" href="<?php echo (isset($meta['url']))?$meta['url']:DOMAIN; ?>" />
<meta property="og:locale" content="vi_VN" />
<meta property="og:type" content="<?php echo (isset($meta['typepage']))?$meta['typepage']:"home page"; ?>" />
<meta property="og:title" content="<?php echo (isset($meta['title']))?$meta['title']:$configAll['NAMESEO_PAGE']; ?>" />
<meta property="og:description" content="<?php echo (isset($meta['des']))?$meta['des']:$configAll['DESSEO_PAGE']; ?>" />
<meta property="og:url" content="<?php echo (isset($meta['url']))?$meta['url']:DOMAIN; ?>" />
<link href="<?php echo DOMAIN; ?>/access/css/style.css" type="text/css" rel="stylesheet" />
<link href="<?php echo DOMAIN; ?>/access/css/menu.css" type="text/css" rel="stylesheet" />
<link href="<?php echo DOMAIN; ?>/access/css/home.css" type="text/css" rel="stylesheet" />
<link href="<?php echo DOMAIN; ?>/access/font-awesome-4.3.0/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
<script src="<?php echo DOMAIN; ?>/access/js/jquery-1.10.1.min.js"></script>
<script src="<?php echo DOMAIN; ?>/access/js/jquery-migrate-1.2.1.min.js"></script>
<script src="<?php echo DOMAIN; ?>/access/js/jquery.menu-aim.js" type="text/javascript"></script>
<script src="<?php echo DOMAIN; ?>/access/js/bootstrap.min.js" type="text/javascript"></script>
<script src="<?php echo DOMAIN; ?>/access/js/jquery.vticker.js" type="text/javascript"></script>
<script>
$(function(){
	$('#single').vTicker();
});
</script>
</head>

<body>
<!-- menu code -->
<header>
    <div id="top-bar">
        <div id="content-bar">
            <nav id="fisrt-menu">
                <?php
                if(count($newsHot)>0)
                {
                ?>
                <div id="single">
                    <ul>
                        <?php
                        foreach($newsHot as $rows)
                        {
                        ?>
                        <li>
                            <a href="" title="<?php echo $rows['NAME_NEWS']; ?>"><?php echo $rows['NAME_NEWS']; ?> &nbsp;<img src="<?php echo DOMAIN;?>/access/images/hot.gif"></a>
                        </li>
                        <?php
                        }
                        ?>                                  
                    </ul>
                </div>
                <?php
                }
                ?>
            </nav>
            <nav id="second-menu">
                <a href=""><i class="fa fa-shopping-cart"></i> Giỏ hàng</a> 
                <a href=""><i class="fa fa-user"></i> Đăng nhập</a>
                <a href=""><i class="fa fa-user-plus"></i> Đăng ký</a>
            </nav>            
        </div>        
    </div>
    <div id="second-bar">
        <div id="content-secondbar">
            <figure>
                <img src="access/images/techone-nen-trang.png" alt="logo" width="240" height="87" />
            </figure>
            <div id="search-header">
                <form>
                    <input type="text" placeholder="Tìm kiếm sản phẩm" />
                    <input type="button" value="Tìm kiếm"/>
                </form>
                <ul class="trend-search">
                    <li><a>Xu hướng tìm kiếm :</a></li>
                    <li><a href="">Apple</a></li>
                    <li><a href="">Iphone 6 plus</a></li>
                    <li><a href="">Iphone 4s</a></li>
                    <li><a href="">LG</a></li>
                    <li><a href="">Sony</a></li>
                    <li><a href="">Ipad 3</a></li>
                    <li><a href="">HP</a></li>
                    <li><a href="">Samsung</a></li>
                    <li><a href="">Asus</a></li>
                </ul>
            </div>
            <div id="social-bar">
                <ul>
                    <li><a target="_blank" href="<?php echo (isset($configAll['FACEBOOK_PAGE']))?$configAll['FACEBOOK_PAGE']:""; ?>"><i class="fa fa-facebook-square fa-2x"></i></a></li>
                    <li><a target="_blank" href="<?php echo (isset($configAll['GOOGLE_PAGE']))?$configAll['GOOGLE_PAGE']:""; ?>"><i class="fa fa-google-plus-square fa-2x"></i></a></li>
                    <li><a target="_blank" href="<?php echo (isset($configAll['TWITTER_PAGE']))?$configAll['TWITTER_PAGE']:""; ?>"><i class="fa fa-twitter-square fa-2x"></i></a></li>
                    <li><a target="_blank" href="<?php echo (isset($configAll['YOUTUBE_PAGE']))?$configAll['YOUTUBE_PAGE']:""; ?>"><i class="fa fa-youtube-square fa-2x"></i></a></li>
                </ul>
            </div>       
        </div>
    </div>
</header>
<div class="clear-both"></div>
<?php
 function sub($items, $id, $level){
    if($level == 1){
        echo "<ul class='simple'>";
    }
    if($level == 2){
        echo "<ul class='children'>";
    }
      foreach($items as $item){
          if($item['IDPARENT_MENU'] == $id && $level == 1){
            echo "<li class='lisimple'><a href='#'>".$item['NAME_MENU']."</a>";
                sub($items, $item['ID_MENU'],2);
            echo "</li>";
          }
        if($item['IDPARENT_MENU'] == $id && $level == 2){
            echo "<li class='lichildren'><a href='#'>".$item['NAME_MENU']."</a>";
            echo "</li>";            
        }
      }
      echo "</ul>";
 } 
?>
<div id="menu">
    <div class="menu">
        <div class="menuleft">
        	<div class="mnhome"><a href="" class="mahome"><i class="fa fa-bars fa-2x"></i></a></div>
        	<div data-toggle="dropdown" class="dropdown-toggle"><span>Danh mục sản phẩm</span></div>
        	<ul role="menu" class="dropdown-menu homecat">
            <?php
            if(count($allMenu)>0){
            $i = 1;
            foreach($allMenu as $menuItem)
            {
                if($menuItem['IDPARENT_MENU'] == 0){
            ?>								
				<li id="litop<?php echo $i;?>" class="litop lttop" data-submenu-id="top<?php echo $i;?>">
					<a href="" class="atop"><span class="lsicon"><img src="" class="lsimage"></span> <?php echo $menuItem['NAME_MENU'];?></a>
					<div style="display: none;" class="popover" id="top<?php echo $i;?>">
						<img src="" class="ld_image" />						
                        <div class="col_<?php echo $i;?>">
                        <?php sub($allMenu, $menuItem['ID_MENU'],1); ?>
						</div>
					</div>
				</li>
            <?php
                }
                $i ++;
            }
            }
            ?>
 			</ul>
          </div>
          <!-- menu right -->
        <div class="menuright">
        <ul class="mrul">
        	<li class="mrli"><a target="_blank" href="" class="mratop noibat">Khuyến mãi<img src="access/images/hot.gif" /></a></li>
        	<li class="mrli"><a href="" class="mratop">Kho máy cũ</a></li>
        	<li class="mrli"><a href="" class="mratop">Bán trả góp</a></li>
        	<li class="mrli"><a class="mratop mdrop">Tuyển dụng</a></li>
        	<li class="mrli"><a class="mratop mdrop">Dịch vụ</a>
  		     <div class="dropdown_1column">
        		<div class="mcol">
        			<div class="colr">
            			<ul class="showmr">
            			  <li>
							  <a href="">Hướng dẫn mua trả góp</a>
						  </li>
            			  <li>
							  <a href="">Chính sách Bảo hành - Đổi trả</a>
						  </li>
            			  <li>
							  <a href="">Chính sách thẻ thành viên</a>
						  </li>
            			  <li>
							  <a href="">Hướng dẫn tạo tài khoản Apple</a>
						  </li>                                                                            			
                        </ul>
        			</div>
        		</div>
        	  </div>
       		</li>
        	<li class="mrli"><a href="" class="mratop">Tin tức</a></li>
          </ul>
          </div>          
    </div>
</div>
<script src="<?php echo DOMAIN; ?>/access/js/menu.js" type="text/javascript"></script>
<!-- end menu code -->